<template>
  <div class="header">
    <div class="head" v-if="$route.meta.headerShow">
        <span @click="historyGo"><van-icon name="arrow-left" />返回</span>
        <span>{{$route.query.title || $route.meta.title}}</span>
        <router-link tag="span" :to="'/' + $route.meta.headRightPath">
            {{$route.meta.headRight}}
        </router-link>
    </div>
    <div>
        <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      showPicker: false,
      title: ''
    };
  },
  props: [],
  watch: {},
  mounted() {},
  methods: {
    historyGo() {
      history.go(-1);
    }
  }
};
</script>

<style lang="less" scoped>
.header {
    height: 100%;
    overflow-y: auto;
    // overflow: hidden;
    &> div:nth-child(2) {
        height: calc(100% - 100px);
        overflow-y: auto;
    }
}
.head {
    font-size: 34px;
    color: #333333;
    height: 100px;
    padding: 0 24px;
    background: #f5f5f5;
    display: flex;
    background-color: #3198ed;
    align-items: center;
    color: #fff;
    &>span {
        i {
            float: left;
            margin-top: 7px;
        }
    }
    &>span:nth-child(1) {
        width: 25%;
        text-align: left;
    }
    &>span:nth-child(2) {
        width: 50%;
        text-align: center;
    }
    &>span:nth-child(3) {
        width: 25%;
        text-align: right;
    }
}
</style>
